from BSTestRunner import BSTestRunner
import unittest
import time
# 使用unittest批量加载
test_dir=r'../test_case'
discover=unittest.defaultTestLoader.discover(test_dir,pattern='test*.py')
# 拼装测试报告文件名
report_dir=r'../reports/HTMLfiles'
now=time.strftime('%Y_%m_%d_%H_%M_%S')
report_name=rf'{report_dir}/{now}BS.html'
with open(report_name,'wb') as f:
    runner=BSTestRunner(f,title='测试报告',description='测试详情')
    runner.run(discover)
